1. Field of the Invention
The present invention relates to a measuring origin detection method and apparatus for determining a reference position in a position-detecting means such as an optical linear encoder, and more particularly to an origin detection method and apparatus suitably applicable for a simple and compact encoder.
2. Description of the Related Art
A conventional contact and transmission type encoder can sustain a narrow gap in a detection section without variations using a gap holding device of a contact type. Therefore, an origin detection system that forms random patterned origin marks with a fine fundamental pitch or a high spatial frequency on scales can be employed in such the encoder. FIG. 8A is a waveform diagram showing a primary origin signal and an output origin signal obtained from such the random pattern. The primary origin signal contains a sharp peak when the random pattern is used, and a sharp output origin signal can be obtained by slicing the origin signal with a predetermined reference level. Thus, an original position can be detected with a relatively higher reproducibility accordingly.
A non-contact and reflection type encoder is on the other hand required to setting a large gap and allowable variation margin thereof in a detection section in order to maintain a non-contact state. And it is difficult to detect an origin using such a random pattern with a fine fundamental pitch as that of the contact transmission type. Therefore, such a rough slit pattern as shown in FIG. 8B may often be employed
A primary origin signal shown in FIG. 8B has a slow gradient on the edge. Therefore, a method for obtaining an output origin signal by slicing the waveform of the primary origin signal that is obtained from the rough slit pattern with a reference level may vary a position of the edge of the output origin signal due to a temperature drift and the like. The slower the gradient of the primary origin signal, the larger such the variation The variation rate may increase up to 10-30 times that in case of the random pattern of the contact and transmission type being used. If using the output origin signal as it is, the position reproducibility may be lowered disadvantageously by one order relative to the random pattern system.
The present invention has been made in consideration of such the problems and accordingly has an object to provide an origin detection system capable of achieving a more excellent reproducibility than the conventional edge-detecting origin detection system while maintaining a structure of a simple and compact detection section.
The present invention is provided with an origin detection apparatus for detecting an original position serving as a reference for meaning a relative position of an index scale to a main scale. The apparatus comprises a position detecting device for providing a position detection signal in accordance with a variation of the relative position of the index scale to the main scale. The position detecting device also provides a primary origin signal having a variable level in accordance with the degree of an overlap of origin detection patterns formed respectively on the main and index scales. The apparatus also comprises a gate signal generating circuit or generating a gate signal by slicing the primary origin signal with a predetermined reference level. The apparatus further comprise a position pulse counting circuit or beginning to count position pulses derived from the position detection signals when the gate signal generated from the gate signal generating circuit becomes active and dividing a count value by two when the gate signal becomes non-active. A count value obtained from the position pulse counting circuit after divided by two at the position pulse counting circuit gives a reference for origin detection.
The present invention is also provided with an origin detection method for detecting an original position serving as a reference for position measurement by position detection means. The method comprises the step of monitoring a position pulse generated from a position detection signal out of the position detection means and a gate signal obtained by binarizing a primary origin signal with a predetermined reference level and beginning to count the position pulses after the gate signal becomes active. The method also comprises the step of dividing a count value by two when the gate signal becomes non-active. The method further comprises the step of feeding an output origin signal when a count value after divided by two reaches a predetermined offset value.
According to the present invention, the position pulses are counted during the gate signal obtained by binarizing the primary origin signal with the predetermined reference level remains active. Then, the count value is divided by two when a length of the gate signal is completely counted. Thus, a count value that begins at the just medium point between the rise (or fall) and fall (or rise) of the gate signal can be obtained. If the primary origin signal varies slowly, positions of edges obtained by binarizing the signal may vary greatly in general due to the temperature drift and the like while the medium point between the edges, that is, a peak position of the primary origin signal hardly varies. The present invention notices this fact and employs the central position between the edges of the gate signal as a reference. Therefore, even though the gradient of the edge of the primary origin signal is slow, it can hardly effect. Thus, origin detection with an excellent reproducibility can be achieved.
The position pulse counting means counts a gate pulse width during the scale moves and then the count value is divided by two. If an origin output means is further provided for feeding an output origin signal when a count value from the position pulse counting means after divided by two reaches a predetermined offset value, origin detection can be performed in real time when the detection section moves relative to the scale.
Binarization of the primary origin signal produces the gate signal. In such the level comparison process, a comparator with hysteresis characteristic is preferably employed usually to prevent a misdetection due to noises. In case of the present invention, however, if the comparator has a hysteresis characteristic, positions of both edges of the gate signal may shift in either direction. To solve such the problem, the gate signal generating circuit may preferably include first and second comparators The first comparator detects a transition of the primary origin signal from a high level to a low level with the predetermined reference level and detects a transition of the primary origin signal from the low level to the high level with a higher level than the predetermined reference level. The second comparator detects the transition of the primary origin signal from the high level to the low level with a lower level than the predetermined reference level and detects the transition of the primary origin signal from the low level to the high level with the predetermined reference level The gate signal generating circuit further includes a selection circuit for selecting the output from the first comparator during the first half of the duration after the gate signal becomes active and before the gate signal becomes non-active. The selection circuit further selects the output from the second comparator during the second half of the duration These selected outputs are fed as the gate signal
If the gate signal generating means is configured as above, the threshold level for detecting the transition from the high level to the low level used in the first comparator of two comparators with hysteresis characteristics is coincident with the threshold level for detecting the transition from the low level to the high level used in the second comparator. In addition, these transitions are respectively selected at the selection means to generate the gate signal Thus, it is possible to prevent the edge positions of the gate signal from varying while improving the anti-noise performance with the hysteresis characteristic simultaneously.
Other features and advantages of the invention will be apparent from the following description of the preferred embodiments thereof.